package cn.lsc.feign;

import cn.lsc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFallbackFactory implements FallbackFactory<MediaFeignService> {


    @Override
    public MediaFeignService create(Throwable throwable) {
        return new MediaFeignService() {
            @Override
            public JSONResult queryMediaByCourseId(Long courseId) {
                return JSONResult.error("哦豁出错了");
            }

            @Override
            public JSONResult get(Long id) {
                return JSONResult.error("哦豁出错了");
            }
        };
    }
}
